import { memo } from 'react';
import type { FC, PropsWithChildren } from 'react';
import { Alert, Spin } from 'antd';
import QueueAnim from 'rc-queue-anim';

const NoMore: FC<
  PropsWithChildren<{ loadingMore: boolean; noMore: boolean }>
> = ({ loadingMore, noMore }) => {
  return (
    <Spin spinning={loadingMore} tip={'加载中...'}>
      <QueueAnim type={'bottom'} delay={500} className={'mt-16'}>
        {noMore ? (
          <div key={'noMore'}>
            <Alert
              message={'没有更多数据了。。。'}
              type={'info'}
              className={'text-center '}
            />
          </div>
        ) : null}
      </QueueAnim>
    </Spin>
  );
};

export default memo(NoMore);
